
import org.apache.shiro.crypto.hash.Sha512Hash

import grails.util.GrailsUtil

import org.icress.fusion.shiro.*
import org.icress.fusion.admin.*
import org.icress.fusion.b2b.*
import org.icress.fusion.wf.*
import org.icress.fusion.ws.*

class bBootStrap {
    
    def grailsApplication

    def init = { servletContext ->
        switch(GrailsUtil.environment) {
            case "development":
                configureForDevelopment()
                break
            case "production":
                break
        }
    }
    def configureForDevelopment = {
        //出站消息配置--订单
        new ObConfig(
            objectName:'salesOrder'
            , method : 'transferSalesOrder'
            , asynchronous : false 
            , priority : 1
            , defaultSendErrorLimit : 1
            , defaultGetErrorLimit : 1
        ).save(flush:true)
        //出站消息配置--信用额
        new ObConfig(
            objectName:'dealer'
            , method : 'creditControl'
            , asynchronous : false
            , priority : 2
            , defaultSendErrorLimit : 1
            , defaultGetErrorLimit : 1
        ).save(flush:true)
        //new OutBound(objectName:'salesOrder', objectId : 1, method : 'INCO1', asynchronous : true).save(flush:true)
   }
    def destroy = {
    }
}
